package com.mye.prometheusexportdcim.utils;

/**
 * @创建人 hch
 * @创建时间 2020/7/24 14:41
 * @描述 TODO
 * @版本 1.0.0
 */
public class LogLocalityUtil {
    private static StringBuilder sb = new StringBuilder();

    public static String getLogLocality() {
        if (sb != null) {
            sb.setLength(0);
        }
        StackTraceElement[] trace = Thread.currentThread().getStackTrace();
        StackTraceElement tmp = trace[2];
        return sb.append(tmp.getMethodName())
                .append("(")
                .append(tmp.getFileName())
                .append(":")
                .append(tmp.getLineNumber())
                .append(")").toString();

    }
}